let passlogin = document.querySelector('.passlogin')
let codelogin = document.querySelector('.Verification-code-login')
let submit = document.querySelector('.submit')
let username = document.querySelector('.account')
let password = document.querySelector('.password')

passlogin.addEventListener('click',function () {
    passlogin.classList.add('Pseudo-class')
    codelogin.classList.remove('Pseudo-class')
})
codelogin.addEventListener('click',function () {
    codelogin.classList.add('Pseudo-class')
    passlogin.classList.remove('Pseudo-class')
})
submit.addEventListener('click',function () {
    if (username.value!==''&&password.value!==''){
        console.log(1212)
        myaxios({
            url:'http://localhost:8080/login',
            method:'post',
            data:{
                username:username.value,
                password:password.value
            }
        }).then(result => {
           if (result===''){
               alert("帐号或密码错误")
           }else {
               location.href = 'index.html'
           }
        })
    }

})